<div class="header">
    <div class="main_menu">
        <ul>
            <?php
            $url = basename($_SERVER['PHP_SELF']);
            $class = " class=\"selected_item\"";

            $index = "";
            $service = "";
            $serviceDetail = "";
            $product = "";
            $productDetail = "";
            $contact = "";
            $event = "";

            switch ($url) {
                case "index.php": $index = "1";
                    break;
                case "service.php": $service = "1";
                    break;
                case "service-detail.php": $serviceDetail = "1";
                    break;
                case "product.php": $product = "1";
                    break;
                case "productDetail.php": $productDetail = "1";
                    break;
                case "contact.php": $contact = "1";
                    break;
                case "event.php": $event = "1";
                    break;
            }
            ?>
            <li <?php if ($index != "")
                echo $class; ?>><a href="index.php"><?php echo $langs["home"]; ?></a>
            </li>
            <li <?php if ($service != "" || $serviceDetail != "")
                echo $class; ?>><a href="service.php">4S</a>
            </li>
            <li <?php if ($product != "" || $productDetail != "")
                echo $class; ?>><a href="product.php"><?php echo $langs["product"]; ?></a>
            </li>
            <li <?php if ($event != "")
                echo $class; ?>><a href="event.php"><?php echo $langs["event"]; ?></a>
            </li>
            <li <?php if ($contact != "")
                echo $class; ?>><a href="contact.php"><?php echo $langs["contact"]; ?></a>
            </li>
        </ul>
    </div>
    <div class="banner">
        <img src="../images/layout/address_panel.png" width="900" height="120" />
        <div class="user_block">
            <br />
            <?php
            if (isset($_SESSION["username"][1])) {
                echo $langs["hello"] . ": <span>" . $_SESSION["username"][1] . "</span>";
            } else {
                echo "<a style='cursor: pointer' onclick='showLogin()'>" . $langs["signIn"] . "</a> | <a href=\"register.php\">" . $langs["signUp"] . "</a>";
            }
            ?>
            <br /> 
            <?php
            if (isset($_SESSION["username"][1])) {
                ?> 
                <a href="user-account.php"><?php echo $langs["home.information"]; ?> </a> | 
    <?php
}
?>
            <a href="cart.php"> <?php echo $langs["home.cart"]; ?> </a>
<?php
if (isset($_SESSION["username"][1])) {
    ?> 
                | <a href="#" onclick="window.location.href = '../action/logoutClientAction.php';"> <?php echo $langs["home.signOut"]; ?> </a><br/>
    <?php
} else
    echo "<br/>";
?>
            <div class="en<?php if (isset($_SESSION["lang"]) && $_SESSION["lang"] == "EN")
    echo" act"; ?>" onclick="window.location.href = '../action/changeLangAction.php?url=<?php echo $_SERVER['REQUEST_URI'] . "&lang=EN"; ?>';"></div>
            <div class="vn<?php if ((isset($_SESSION["lang"]) && $_SESSION["lang"] == "VN") || !isset($_SESSION["lang"]))
    echo" act"; ?>" onclick="window.location.href = '../action/changeLangAction.php?url=<?php echo $_SERVER['REQUEST_URI'] . "&lang=VN"; ?>'"></div>
        </div>
    </div>
</div>

<div class="login_box" id='loginDialog' style="display:none;">
    <div class="login_header"><?php echo $langs['loginBox.signInToBuy'] ?></div>
    <table class="login_form">
        <tr>
            <td colspan="2" align="center"><font color="red" id="errorMessage"><?php echo $langs['loginBox.wrongNameOrPass'] ?></font></td>
        </tr>
        <tr>
            <th><?php echo $langs['loginBox.username'] ?>:</th>
            <td><input type="text" name="user_name" id="username" /></td>
        </tr>
        <tr>
            <th><?php echo $langs['loginBox.password'] ?>:</th>
            <td><input type="password" name="password" id="password" /></td>
        </tr>
        <tr>
            <td colspan="2" align="center">
                <div>
                    <a onclick='login();' class="button"><?php echo $langs['signIn'] ?></a>
                    <a onclick='closeLogInDialog();' class="button"><?php echo $langs['close'] ?></a>
                </div>
            </td>
        </tr>
        <tr>
            <td colspan="2" align="center">
                <span><?php echo $langs['loginBox.notYetHaveAccount'] ?></span>
            </td>
        </tr>
    </table>
</div>


<div id='addedToCartDialog' class="addedToCart_box" style="display:none;">
    <table class="addedToCart_form">
        <tr>
            <td><?php echo $langs['addToCartBox.addedToCart'] ?></td>
        </tr>
        <tr>
            <td><a href="cart.php">(<?php echo $langs['addToCartBox.gotoCart'] ?>)</a></td>
        </tr>
    </table>
</div>
